package com.zhiwang.xiaoqu.widget.loopviewpager

import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.viewpager.widget.ViewPager
import com.bumptech.glide.Glide

class SimpleNetWorkLoopingPagerAdapter(context: Context?, itemList: MutableList<String>?, isInfinite: Boolean) :
    LoopingPagerAdapter<String>(context, itemList, isInfinite) {


    override fun inflateView(viewType: Int, container: ViewGroup?, listPosition: Int): View {
        val imageView = ImageView(context)
        imageView.scaleType = ImageView.ScaleType.FIT_XY
        imageView.layoutParams = ViewPager.LayoutParams()
        return imageView
    }

    override fun bindView(convertView: View?, listPosition: Int, viewType: Int) {

        Glide.with(context)
            .load(itemList[listPosition])
            .into(convertView as ImageView)
    }


}